import request from '/@/utils/request';

/**
 * 用文件上传
 * @param params 要传的参数值
 * @returns 返回接口数据
 * @method experimentInfo 获取实验信息
 * @method teacherInfo 获取教师信息
 * @method getFile 获取实验报告信息
 */

export function experimentInfo(params: any) {
	return request({
		url: `experiment?lesson_id=${params}`,
		method: 'get',
	});
}

export function teacherInfo() {
	return request({
		url: 'teacher',
		method: 'get',
	});
}

export function getFile(params: any) {
	return request({
		url: `file?experiment_id=${params.experiment_id}&student_id=${params.student_id}`,
		method: 'get',
	});
}

export function submitFile(params: any) {
	return request({
		url: `file/update/${params.file_id}`,
		method: 'put',
		data: params.info,
	});
}